<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
	
<h:body>
	<ui:composition template="/lnf-template.xhtml">
	
		<ui:define name="title">
			JavaServer Faces Virtual Trainer Application Registration
		</ui:define>
		
		<ui:define name="body">
		
			<h:panelGrid columns="4">
				<h:outputLabel value="First Name" for="fname"/>
				<h:inputText id="fname" required="true" value="#{userBean.firstName}" label="First Name" title="First Name"/>
				<h:message for="fname"/>
				<h:panelGroup/>
				
				<h:outputLabel value="Last Name" for="lname"/>
				<h:inputText id="lname" required="true" value="#{userBean.lastName}" label="Last Name" title="Last Name"/>
				<h:message for="lname"/>
				<h:panelGroup/>
				
				<h:outputLabel value="Sex" for="sex"/>
				<h:selectOneRadio id="sex" required="true" value="#{userBean.sex}" label="Sex" title="Sex">
					<f:selectItem itemValue="male" itemLabel="Male"/>
					<f:selectItem itemValue="female" itemLabel="Female"/>
				</h:selectOneRadio>
				<h:message for="sex"/>
				<h:panelGroup/>
				
				<h:outputLabel value="Date of Birth" for="dob"/>
				<h:inputText id="dob" required="true" value="#{userBean.dob}" maxlength="10" label="Date of Birth" title="Date of Birth">
					<f:convertDateTime pattern="MM/dd/yyyy"/>
				</h:inputText> (mm/dd/yyyy)
				<h:message for="dob"/>
				
				<h:outputLabel value="Email Address" for="email"/>
				<h:inputText id="email" required="true" value="#{userBean.email}" validator="#{userBean.validateEmail}" label="Email Address" title="Email Address"/>
				<h:message for="email"/>
				<h:panelGroup/>
				
				<h:outputLabel value="Service Level" for="serviceLevel"/>
				<h:selectOneMenu id="serviceLevel" value="#{userBean.serviceLevel}" label="Service Level" title="Service Level">
					<f:selectItem itemValue="medium" itemLabel="Medium"/>
					<f:selectItem itemValue="basic" itemLabel="Basic"/>
					<f:selectItem itemValue="premium" itemLabel="Premium"/>
				</h:selectOneMenu>
				<h:panelGroup/>
				<h:panelGroup/>
			</h:panelGrid>
				
			<p><h:messages/></p>
			<p><h:commandButton value="Register" action="confirm"/></p>
			<p><h:commandButton value="Cancel" action="index" immediate="true"/></p>
		</ui:define>
		
	</ui:composition>
</h:body>
</html>